package com.agentframework.examples.jinhua;

import com.agentframework.core.environment.AbstractEnvironment;
import com.agentframework.core.environment.EnvironmentEndCondition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 诈金花游戏结束条件
 * @author wangjun
 */
public class JinhuaGameEndCondition implements EnvironmentEndCondition {

    protected static final Logger logger = LoggerFactory.getLogger(JinhuaGameEndCondition.class);

    @Override
    public boolean shouldEnd(AbstractEnvironment environment) {
        logger.debug("JinhuaGameEndCondition -> shouldEnd -> JinhuaGameState: {} ", ((JinhuaEnvironment) environment).getJinhuaGameState());
        return ((JinhuaEnvironment) environment).getJinhuaGameState().isGameOver();
    }

} 